package apache.date;

import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang.time.FastDateFormat;

import java.text.ParseException;
import java.util.Date;

public class DateDemo {
    public static void main(String[] args) throws ParseException {
        String DATE_FORMAT = "yyyyMMddhhmmss";
        FastDateFormat fdf = FastDateFormat.getInstance(DATE_FORMAT);
        String src = DateFormatUtils.format(new Date(), DATE_FORMAT);
        System.out.println(src);
        System.out.println(DateUtils.parseDate(src, new String[]{DATE_FORMAT}));
        System.out.println(fdf.format(new Date()));


    }
}
